<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no">
	<title>日新网</title>
	<link rel="stylesheet" href="__TMPL__Public/assets/css/bootstrap.min.css">
	<link rel="stylesheet" href="__TMPL__Public/assets/css/reset.css">
	<link rel="stylesheet" href="__TMPL__Public/assets/css/style.css">
	<script type="text/javascript" src="__TMPL__Public/assets/js/rem.js"></script>
	<style>
        /*专栏认证 导航样式？*/
        .column_introduce_page .row1 span{
            color: #000232;
        }
        .column_introduce_page {
            border-bottom: 2px solid #afafbd;
        }
        .column_introduce_page .row1 {
            padding-top: .12rem ;
            padding-bottom: .12rem;
            margin-top: .28rem;
            background: url("./images/lt.png") left center no-repeat;
            background-size: .18rem .18rem;

        }
        .text textarea ,input{
            background-color: #f9f9f9!important;

        }
        .text p {
            font-weight: bolder;
            margin-bottom: .15rem;
        }
        .timer input{
            width: 49%;
            display: inline-block;

        }
        .item_delete {

            text-align: center;
            margin-top: .5rem;
            letter-spacing: 1px;
        }
        .item_delete a {
            color: #000232;
        }

	</style>
</head>
<body>
	<!--nav-->
    <tc_include file="Public:nav"/>

    <!--专栏认证头部开始-->
    <div class="comWidth column_introduce_page">
        <div class="container ">
           <div class="row row1">
               <div class="col-xs-6">
                   <a href="{:U('professor/professor/professor_edit')}"><span>&nbsp;< 返回</span></a>
               </div>
               <div class="col-xs-6 text-right">
                   <a class="add_mod_pf_col" href="javascript:;"><span>保存</span></a>
               </div>
           </div>
        </div>
    </div>
    <div style="height: .5rem;"></div>
    <div class="comWidth">
        <form method="post" action="{:U('professor/professor/pf_certificate_edit')}">
            <input type="hidden" name="id" value="{$pf_certificate.id}">
            <div class="form-group">
                <label>认证名称:</label>
                <input type="text" class="form-control" name="certificate_name" value="{$pf_certificate.certificate_name}" placeholder="认证名称">
            </div>
            <div class="form-group">
                <label>有效时间</label>
                <p></p>
                <p class="timer clearfix">
                    <input type="date" class="form-control pull-left" name="start_time" value="{$pf_certificate.start_time}" placeholder="" >
                    <input type="date" class="form-control pull-right" name="end_time" value="{$pf_certificate.end_time}" placeholder="" >
                </p>

            </div>
            <div class="form-group">
                <label>证书编号:</label>
                <input type="text" class="form-control" name="certificate_no" value="{$pf_certificate.certificate_no}" placeholder="证书编号">
            </div>
            <div class="form-group">
                <label>认证机构:</label>
                <input type="text" class="form-control" name="certification"  value="{$pf_certificate.certification}" placeholder="认证机构">
            </div>
            <if condition="!empty($pf_certificate['id'])">
                <p class="item_delete">
                    <a class="del_pf_col" data-id="{$pf_certificate.id}" data-href="{:U('professor/professor/pf_certificate_edit')}">删除此项</a>
                </p>
            </if>
        </form>

    </div>
	<!--页脚-->
    <tc_include file="Public:footer"/>
    <script type="text/javascript" src="__TMPL__Public/assets/js/jquery.1.12.4.js"></script>
    <script src="__TMPL__Public/assets/js/bootstrap.min.js"></script>
    <script src="__PUBLIC__/js/layer/layer_1.js"></script>
    <script>
        $(document).ready(function () {

            // 删除
            $('.del_pf_col').click(function () {
                var url = $(this).attr('data-href');
                var id  = $(this).attr('data-id');
                layer.confirm("确认删除？", {
                    btn: ['确定', '取消']
                }, function () {
                    $.post(url, {id : id, delete : 1}, function (re) {
                        layer.msg(re.info);
                        if (re.status) {
                            setTimeout(function () {
                                window.location.href = "{:U('professor/professor/professor_edit')}";
                            }, 2000);
                        }
                    })
                });
            });

            // 修改 or 添加
            $('.add_mod_pf_col').click(function () {
                $('form').submit();
            })
        })
    </script>
</body> 
</html>